import store from '@/store/index.js'

export default {
  methods: {
    hasPermission(code) {
      if (!code) {
        this.$Message.error({
          content: '查询权限必须提供权限code',
          duration: 3
        })
      }
      let operatePermissions = []
      
      store.state['ripples-components']['resList']
      if (store.state['ripples-components'] && store.state['ripples-components']['resList']) {
        operatePermissions = store.state['ripples-components']['resList']
      }
      return operatePermissions.includes(code);
    },
  }
}
